package com.oet.persistence.entity;

// Generated Feb 6, 2010 2:13:01 PM by Hibernate Tools 3.2.4.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;


/**
 * Category
 */
@Entity
@Table(name = "category", catalog = "oet",
		uniqueConstraints = @UniqueConstraint(columnNames = {"name"}))
public class Category implements java.io.Serializable {

	private Long id;
	private String name;
	private List<CourseSeries> courseSeriess = new ArrayList<CourseSeries>(0);

	public Category() {
	}

	public Category(String name) {
		this.name = name;
	}

	

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "name", unique = true, nullable = false)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	

	
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "category")
	@OrderBy("id desc")
	public List<CourseSeries> getCourseSeriess() {
		return this.courseSeriess;
	}
	public void setCourseSeriess(List<CourseSeries> courseSeriess) {
		this.courseSeriess = courseSeriess;
	}
	
	
	
	
	

}
